package com.ewing.extranal.im;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.ewing.extranal.im.service.ImUser;
import com.ewing.extranal.im.service.ImUserImpl;

public class LoginTestServlet extends HttpServlet {
    /**
   * 
   * created by Joeson on 2016年5月21日 上午10:40:14
   */
  private static final long serialVersionUID = 1L;
    /**
     * Logger for this class
     */
    private static final Logger logger = Logger.getLogger(LoginTestServlet.class);

    public void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String userId = request.getParameter("imUserId");
        String userName = request.getParameter("userName");
        request.getSession().setAttribute("imUserId", Long.valueOf(userId));
        ImUser imUser = new ImUserImpl();
        imUser.addImUser(Long.valueOf(userId), userName, null);
    }

    public void destroy() {
        super.destroy();
    }

}